# # while循环模拟登录界面
# i = 0
# user_name = 'admin'
# user_password = '123456'
# while i < 3:
#     i += 1
#     userName = input('请输入用户名：')
#     userPassword = input('请输入密码：')
#     if userName == 'admin' and userPassword == '123456':
#         print('登录成功！')
#         break
#     else:
#         if i < 3:
#             print('用户名或密码错误，请重新输入')
#             print('您还有' + str(3 - i) + '次机会')
# if i == 3:
#     print('登录失败，请过段时间再来重试！')
from turtledemo.chaos import jumpto

# 打印图形

# 打印矩形
# i = 0
# while i < 3:
#     j = 0
#     while j < 4:
#         print('*',end='')
#         j += 1
#     i += 1
#     print()

# 打印正直角三角形
# i = 0
# while i < 5:
#     i += 1
#     j = 0
#     while j < i:
#         print('*', end='')
#         j += 1
#     print()

# 打印倒直角三角形
# i = 5
# while i > 0:
#     j = 0
#     while j < i:
#         print('*',end='')
#         j += 1
#     i -= 1
#     print()

# # 打印等腰三角形
# i = 0
# while i < 5:
#     # 先得打印空格，再打印图形
#     j = 0
#     while j < 5-i-1:
#         print(' ',end='')
#         j += 1
#     j = 0
#     while j < 2*i+1:
#         print('*',end='')
#         j += 1
#     i += 1
#     print()

# # 打印实体菱形
# # 分解成一个上三角和一个下三角
# n = eval(input('请输入菱形的行数：'))
# up = n // 2 + 1 # 上三角的行数
# down = n // 2 # 下三角的行数
# # 先打印上三角
# i = 0
# while i < up:
#     # 先打印空格，再打印图形
#     j = 0
#     while j < down-i:
#         print(' ',end='')
#         j += 1
#     j = 0
#     while j < 2*i+1:
#         print('*',end='')
#         j += 1
#     i += 1
#     print()
# # 再打印下三角
# i = 0
# while i < down:
#     # 先打印空格，再打印图形
#     j = 0
#     while j < i+1:
#         print(' ',end='')
#         j += 1
#     j = 0
#     while j < (down-i)*2-1:
#         print('*',end='')
#         j += 1
#     i += 1
#     print()


# 打印空心菱形
# 同样分解为上空心三角形和下空心三角形

# n = eval(input('请输入菱形的行数：'))
# up = n // 2 + 1
# down = n // 2
# # 打印上空心三角
# i = 0
# while i < up:
#     j = 0
#     while j < down-i:
#         print(' ',end='')
#         j += 1
#     j = 0
#     while j < 2*i+1:
#         # 只需在第一个和最后一个打印星号，其余皆是空格
#         if j == 0 or j == 2*i :
#             print('*',end='')
#         else :
#             print(' ',end='')
#         j += 1
#     i += 1
#     print()
# # 打印下空心三角
# i = 0
# while i < down :
#     # 先打印空格，再打印图形
#     j = 0
#     while j < i+1 :
#         print(' ',end='')
#         j += 1
#     j = 0
#     while j < (down-i)*2-1 :
#         if j == 0 or j == (down-i)*2-2 :
#             print('*', end='')
#         else :
#             print(' ', end='')
#         j += 1
#     i += 1
#     print()